//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<redirect.h>
///	@path	~/xeres/src/lib/system/
///	@date	2007/12/15
///	@desc	Redirect stdio.

#pragma once

#include "xeres.h"

#include "lib/utilities/callback.h"

namespace xeres {

	/*!
		\brief	Redirects Standard IO to function callback.
	*/
	bool redirect_stdio( const wchar_t * pipename ,
		function<void(const char*)> call_stdout ,
		function<void(const char*)> call_stderr );

	/*!
		\brief	Reset Standard IO redirection.
	*/
	void reset_redirect( void );

} // namespace xeres
